﻿using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using MS.InformationManagement.Presenter.Support;
using MS.InformationManagement.Presenter.ExcluirRadicadoRecord;
using MS.InformationManagement.Support;

namespace MS.InformationManagement.WP.Layouts.MS.InformationManagement.WP
{
    public partial class ExcludeFileRecord : BaseApplicationPage, IExcludeRadicadoView
    {

        #region fields

        ExcludeRadicadoPresenter _presenter;

        #endregion

        #region Properties

        public string RadicadoId { get { return Page.Request.QueryString["RadicadoId"]; } }

        public string ListName { get { return Page.Request.QueryString["ListName"]; } }

        public string ExpedienteListName { get { return Page.Request.QueryString["ExpedienteListName"]; } }

        #endregion

        #region Form Events

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            lblMessage.Text = "Realmente desea excluir este radicado de su expediente?";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                _presenter = new ExcludeRadicadoPresenter(this);
            }
            catch (Exception ex)
            {
                HandleError(ex);
            }
        }

        protected void Action_Ok(object sender, EventArgs e)
        {
            try
            {
                _presenter.ExcludeRadicado();
            }
            catch (Exception ex)
            {
                HandleError(ex);
            }
        }

        protected void Action_Cancel(object sender, EventArgs e)
        {
            this.CloseWindow(true);
        }

        #endregion

        #region ImplementedMethods

        public void Close()
        {
            this.CloseWindow(true);
        }

        #endregion

    }
}
